﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Models;
using DAL;
using System.Data.SqlClient;
using models;

namespace BLL
{
   public class DateManager
    {
        //dataMDateManager
        dateService Service = new dateService();
        public List<Yearr> GetYear()
        {
            List<Yearr> yearrs = new List<Yearr>();
            SqlDataReader reader = Service.selectyear();
            while (reader.Read())
            {
                yearrs.Add(
                    new Yearr(
                        reader.GetInt32(0)        
                        ));
            }
            DBhelper.Close();
            return yearrs;
        }

        public List<Monthh> GetMonthh()
        {
            List<Monthh> monthhs = new List<Monthh>();
            SqlDataReader reader = Service.selectmonth();
            while (reader.Read())
            {
                monthhs.Add(
                    new Monthh(
                        reader.GetString(0)
                        ));
            }
            DBhelper.Close();
            return monthhs;
        }

        public List<Dayy> GetDay()
        {
            List<Dayy> dayys = new List<Dayy>();
            SqlDataReader reader = Service.selectday();
            while (reader.Read())
            {
                dayys.Add(
                    new Dayy(
                        reader.GetString(0)
                        ));
            }
            DBhelper.Close();
            return dayys;
        }

        public List<Dayy> GetDaya()
        {
            List<Dayy> dayys = new List<Dayy>();
            SqlDataReader reader = Service.selectdaya();
            while (reader.Read())
            {
                dayys.Add(
                    new Dayy(
                        reader.GetString(0)
                        ));
            }
            DBhelper.Close();
            return dayys;
        }

        public List<Dayy> GetDayb()
        {
            List<Dayy> dayys = new List<Dayy>();
            SqlDataReader reader = Service.selectdayb();
            while (reader.Read())
            {
                dayys.Add(
                    new Dayy(
                       reader.GetString(0)
                        ));
            }
            DBhelper.Close();
            return dayys;
        }

        public List<Dayy> GetDayc()
        {
            List<Dayy> dayys = new List<Dayy>();
            SqlDataReader reader = Service.selectdayc();
            while (reader.Read())
            {
                dayys.Add(
                    new Dayy(
                       reader.GetString(0)
                        ));
            }
            DBhelper.Close();
            return dayys;
        }
    }
}
